package com.sky.mapper;

import com.sky.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.Map;

/**
 * @aothor LentDent1
 * @vision 1.0
 */
@Mapper
public interface UserMapper {

    /**
     * 根据openid查询用户
     * @param openid
     * @return
     */
    @Select("SELECT * from user where openid = #{openid}")
    User getByOpenId (String openid) ;

    @Select("select * from user where id = #{userId}")
    User getById (Long userId);
    /**
     * 插入数据
     * @param user
     */
    void insert(User user);

    /**
     * 计算用户数量
     * @param map
     * @return
     */
    Integer countByMap(Map map);
}
